package com.origin.netlibrary.download;

import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class DownSaveFileType {
    public static final int APP_TYPE = 0;
    public static final int IMAGE_TYPE = 1;
    public static final int OTHER_TYPE = 2;

    public static final String APP_TYPE_STT = "app";
    public static final String IMAGE_TYPE_STT = "image";
    public static final String OTHER_TYPE_STT = "other";

    @IntDef(value = {
            APP_TYPE,
            IMAGE_TYPE,
            OTHER_TYPE
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface fileType {
    }

    public static String getTypeFileStr(@fileType int type) {
        if (type == APP_TYPE) {
            return APP_TYPE_STT;
        }
        if (type == IMAGE_TYPE) {
            return IMAGE_TYPE_STT;
        }
        return OTHER_TYPE_STT;
    }

}
